package com.sky.mapper.admin;

import com.github.pagehelper.Page;
import com.sky.anno.AutoFill;
import com.sky.enumeration.OperationType;
import com.sky.pojo.Setmeal;
import com.sky.vo.SetmealVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author ljk74
 */
@Mapper
public interface SetmealMapper {

    /**
     * 根据分类id查询套餐的数量
     * @param id
     * @return
     */
    @Select("select count(id) from setmeal where category_id = #{categoryId}")
    Integer countByCategoryId(Long id);

    @AutoFill(OperationType.INSERT)
    void insertSetmeal(Setmeal setmeal);

    Page<SetmealVO> pageQuery(Setmeal setmeal);

    List<Setmeal> selectByIds(List<Long> ids,Integer status);

    void delSetmeal(List<Long> ids);


    @Select("select * from setmeal where id=#{setmealId}")
    Setmeal selectById(Long setmealId);

    void update(Setmeal setmeal);
}
